goto out; \
} while ( 0 )
+
static int get_free_port(struct domain *d)
{
struct evtchn *chn;
rc = -EINVAL;
goto out;
}
-
+
port2 = chn1->u.interdomain.remote_port;
BUG_ON(!port_is_valid(d2, port2));
return ret;
}
+
void evtchn_set_pending(struct vcpu *v, int port)
{
struct domain *d = v->domain;
}
}
+
void send_guest_virq(struct vcpu *v, int virq)
{
int port = v->virq_to_evtchn[virq];
evtchn_set_pending(v, port);
}
+
void send_guest_pirq(struct domain *d, int pirq)
{
int port = d->pirq_to_evtchn[pirq];
evtchn_set_pending(d->vcpu[chn->notify_vcpu_id], port);
}
+
static long evtchn_status(evtchn_status_t *status)
{
struct domain *d;
return rc;
}
+
long evtchn_bind_vcpu(unsigned int port, unsigned int vcpu_id)
{
struct domain *d = current->domain;
return rc;
}
+
static long evtchn_unmask(evtchn_unmask_t *unmask)
{
struct domain *d = current->domain;
return 0;
}
+
long do_event_channel_op(GUEST_HANDLE(evtchn_op_t) uop)
{
long rc;
}
+int evtchn_open_reserved_port(struct domain *d)
+{
+ struct evtchn *chn;
+ int port;
+
+ spin_lock(&d->evtchn_lock);
+
+ if ( (port = get_free_port(d)) >= 0 )
+ {
+ chn = evtchn_from_port(d, port);
+ chn->state = ECS_RESERVED;
+ }
+
+ spin_unlock(&d->evtchn_lock);
+
+ return port;
+}
+
+
+void evtchn_close_reserved_port(struct domain *d, int port)
+{
+ struct evtchn *chn;
+
+ spin_lock(&d->evtchn_lock);
+
+ BUG_ON(!port_is_valid(d, port));
+
+ chn = evtchn_from_port(d, port);
+ chn->state = ECS_FREE;
+ chn->notify_vcpu_id = 0;
+
+ spin_unlock(&d->evtchn_lock);
+}
+
+
+void evtchn_notify_reserved_port(struct domain *d, int port)
+{
+ struct evtchn *chn = evtchn_from_port(d, port);
+ evtchn_set_pending(d->vcpu[chn->notify_vcpu_id], port);
+}
+
+
int evtchn_init(struct domain *d)
{
spin_lock_init(&d->evtchn_lock);
/* Bind a local event-channel port to the specified VCPU. */
extern long evtchn_bind_vcpu(unsigned int port, unsigned int vcpu_id);
+/* Reserved event-channel ports for other Xen subsystems. */
+int evtchn_open_reserved_port(struct domain *d);
+void evtchn_close_reserved_port(struct domain *d, int port);
+void evtchn_notify_reserved_port(struct domain *d, int port);
+
#endif /* __XEN_EVENT_H__ */